package com.clw.repository;

import com.clw.dataobject.Product;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;


/**
 * Created by Administrator on 2017-12-15.
 */
public interface ProductRepository extends JpaRepository<Product,Integer>{

    Product findByName(String productName);

    Page<Product> findAll(Specification<Product> spec, Pageable pageable);

    Long count(Specification<Product> spec);

    Product findById(Integer id);
}
